﻿using B.W.traceability.Domain.养殖;
using B.W.traceability.ErrorCode;
using B.W.traceability.Read.API.Application.APPlicationCommand;
using B.W.traceability.Read.API.DTO;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace B.W.traceability.Read.API.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class TraceabilityController : ControllerBase
    {
        private readonly IMediator mediator;

        public TraceabilityController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        [HttpGet]
        public Task<APIResult<List<TraceabilityNames>>> TraceabilityCommand([FromQuery]TraceabilityCommand request)
        {
           return mediator.Send(request);
        }
        [HttpGet]
        public Task<APIResult<APIPResult<TraceabilityDTO>>> TraceabilityShowCommand([FromQuery]TraceabilityShowCommand request)
        {
            return mediator.Send(request);
        }
        [HttpDelete]
        public Task<APIResult<object>> TraceabilityDeleteCommand([FromQuery]TraceabilityDeleteCommand request)
        {
            return mediator.Send(request);

        }
    }
}
